U_CAPI UBiDiDirection U_EXPORT2 ubidi_getVisualRun (UBiDi *pBiDi, UTextOffset runIndex, UTextOffset *pLogicalStart, UTextOffset *pLength)

Get one run's logical start, length, and directionality, which can be 0 for LTR or 1 for RTL

Documentation

Get one run's logical start, length, and directionality, which can be 0 for LTR or 1 for RTL. In an RTL run, the character at the logical start is visually on the right of the displayed run. The length is the number of characters in the run.

ubidi_countRuns() should be called before the runs are retrieved.

Returns:
the directionality of the run, UBIDI_LTR==0 or UBIDI_RTL==1, never UBIDI_MIXED.
Parameters:
pBiDi - is the paragraph or line UBiDi object.
runIndex - is the number of the run in visual order, in the range [0..ubidi_countRuns(pBiDi)-1].
pLogicalStart - is the first logical character index in the text. The pointer may be NULL if this index is not needed.
pLength - is the number of characters (at least one) in the run. The pointer may be NULL if this is not needed.
See Also:
ubidi_countRuns Example:
  UTextOffset i, count=ubidi_countRuns(pBiDi),
          logicalStart, visualIndex=0, length;
  for(i=0; i<count; ++i) {
      if(UBIDI_LTR==ubidi_getVisualRun(pBiDi, i, &logicalStart, &length)) {
          do {               show_char(text[logicalStart++], visualIndex++);
          } while(--length>0);
      } else {
          logicalStart+=length;            do {               show_char(text[--logicalStart], visualIndex++);
          } while(--length>0);
      }
  }
Note that in right-to-left runs, code like this places modifier letters before base characters and second surrogates before first ones.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de